package com.kwq.shixi.controller;


import com.kwq.shixi.model.Test;
import com.kwq.shixi.service.TestService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;

@RestController
@Api
public class TestController {
       @Autowired
    private TestService testService;

       @RequestMapping("/create")
    public void createTest(@RequestBody Test test){
           testService.create(test);
       }

    @RequestMapping("/create1")
    public void createTest1( Test test){
        testService.create(test);
    }

    @RequestMapping("/list")
    public Object list(Integer id,String name){
        System.out.println("id=>"+id);
        System.out.println("name=>"+name);
        int[] res = {1, 2, 3, 4};
        return res;

    }



}
